$(function() {
	$('#submitForm').validate({
		debug: true, //调试模式取消submit的默认提交功能   
        focusInvalid: false, 
        onkeyup: false,   
        submitHandler: function(form){  
            if (typeof jQuery.data(this, "disabledOnSubmit") == 'undefined') {
            	jQuery.data(this, "disabledOnSubmit", {submited : true});
            	if (confirm("确认发货？")){
                    form.submit();
                } else{
                    jQuery.removeData(this, "disabledOnSubmit");
                }
            } else {
            	// repeat submit ignore;
            }
        },
        success:function(element){
        	element.siblings("span[class='red']").text("");
        },
		errorPlacement : function(error, element) {
			element.siblings("span[class='red']").text(error.text());
		},
        rules:{
			batchNumber:{required:true,isFulString:true},
            logisticsCompany:{required:true}
        },
        messages:{
			batchNumber:{required:"请输入物流单号",isFulString:"请输入正确的物流单号"},
            logisticsCompany:{required:"请输入物流公司"}
        }
	});
});